import VueRouter from "vue-router"
import Vue from "vue"

Vue.use(VueRouter)

const routes = [
    { name:'login',path: '/login',component:()=>import('@/views/LoginView')},
    { name:'search',path:'/search',component:()=>import('@/views/SearchView')},
    { name:'houseDetail',path:'/houseDetail',component:()=>import('@/views/InfoView')},
    { name:'home',path:'/',component:()=>import('@/views/HomeView')},
    { name:'message',path:'/message',component:()=>import('@/views/MessageView')},
    { name:'userView',path:'/user',component:()=>import('@/views/UserView'),
        children: [
            { name:'profile',path:'/userProfile',component:()=>import('@/views/UserDetailsView')},
            { name:'userInfo',path:'/userInfo',component:()=>import('@/views/UserInfoView')}
        ]
    },
    { name:'register',path:'/register',component:()=>import('@/views/RegisterView'),
        children: [
            { name:'account',path:'/account',component:()=>import('@/views/RegisterAccountView')},
            { name:'info',path:'/info',component:()=>import('@/views/UserDetailsView')},
            { name:'finish',path:'/finish',component:()=>import('@/views/RegisterFinishView')},
        ]
    },
    { name:'contract',path:'/contract',component:()=>import('@/views/ContractView')},
]

const router = new VueRouter({
    mode:'hash',
    routes
})

export default router